package com.lagou.code.service.Impl;

import com.lagou.code.service.CodeService;
import com.lagou.common.vo.MsgCode;
import com.lagou.common.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CodeServiceImpl implements CodeService {

    @Autowired
    com.lagou.code.mapper.loginMapper loginMapper;

    public MsgCode searchMsgCode(String email) {
        return loginMapper.searchMsgCode(email);
    }

    public void insertMsgCode(String email,String code) {
        long sysTime = System.currentTimeMillis();
        loginMapper.insertMsgCode(email,code,sysTime);
    }


    public void deleteMsgCode(String email) {
        loginMapper.deleteMsgCode(email);
    }

    public User searchUSER(String email) {
        return loginMapper.searchUSER(email);


    }
    public void insertUSER(String email,String password) {
        loginMapper.insertUSER(email,password);
    }

}
